package kr.co.one;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;

public class ArraySort {
	ArrayList<String> b= new ArrayList<String>();
	public void sorting(ArrayList num){
		
		for (int i = 0; i < num.size(); i++) {
			b.add(num.get(i)+"");
			
		}
		
		Collections.sort(b);

		for (int i = 0; i < b.size(); i++) {
			if(b.get(i).toString().contains("B")){
				System.out.print(b.get(i).toString().replace('B', 'J'));
				}
				else if(b.get(i).toString().contains("C")){
					System.out.print(b.get(i).toString().replace('C', 'Q'));
				}else{
					System.out.print(b.get(i));
				}	
		}
		System.out.println();
	}
	
	public ArrayList getSort(){
		return b;
	}
}
